'''
You will enjoy grander sight,
by climbing to a greater height.
欲穷千里目，更上一层楼。
    ——王之涣《登鹳雀楼》
'''

# encrpyt
key = 3

# 明文
plain_text = '''
You will enjoy grander sight,
by climbing to a greater height.
'''

# 密文
cipher_text = ''

for char in plain_text:
    # 字符是否为字母
    if char.isalpha():
        # 根据待加密的字母大小写，设定偏移量的基准值
        # 是从'A'/65开始，还是从'a'/97开始计算
        if char.isupper():
            base = 'A'
        else:
            base = 'a'

        # 加密: E(x) = (x+k) mod 26
        cipher_text += chr((ord(char) - ord(base) + key) % 26 + ord(base))
    else:
        cipher_text += char

print(cipher_text)
